Skip to content

Conversation

@universome
Copy link
Contributor

Sometimes, the decoder might lack parameters and only buffers (e.g., this happens when we manually need to convert all the parameters to buffers — e.g. to avoid packing fp16 and fp32 parameters with FSDP)

What does this PR do?

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Sometimes, the decoder might lack parameters and only buffers (e.g., this happens when we manually need to convert all the parameters to buffers — e.g. to avoid packing fp16 and fp32 parameters with FSDP)
@sayakpaul
Copy link
Member

Could you maybe elaborate a bit more where this is useful?

@sayakpaul sayakpaul requested a review from DN6 November 7, 2024 15:03
@sayakpaul
Copy link
Member

@universome a gentle ping

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@DN6
Copy link
Collaborator

DN6 commented Dec 2, 2024

@universome Would it be possible to handle the merge conflict? We can merge this after.

@universome
Copy link
Contributor Author

Hi @DN6 , sorry for the late reply. Basically, my use-case is the following.
I'm training a video latent diffusion model with the CogVideoX autoencoder with FSDP wrapping.
I instantiate the autoencoder inside the base model class, wrap the base model in FSDP, and now I need to make sure that it does not get FSDP-wrapped (to avoid extra syncs for it since it's quite small in terms of the parameter counts anyway).
One way to do this is to simply convert AE parameters to buffers (which would cause the error above). The other is to add changes to FSDP wrap policy to make sure it's not wrapped. I felt that the conversion to buffers is simpler since in this case I also do not need to bother about setting requires_grad to False for them.

@yiyixuxu yiyixuxu merged commit 8421c14 into huggingface:main Dec 4, 2024
15 checks passed
lawrence-cj pushed a commit to lawrence-cj/diffusers that referenced this pull request Dec 4, 2024
Sometimes, the decoder might lack parameters and only buffers (e.g., this happens when we manually need to convert all the parameters to buffers — e.g. to avoid packing fp16 and fp32 parameters with FSDP)
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
Sometimes, the decoder might lack parameters and only buffers (e.g., this happens when we manually need to convert all the parameters to buffers — e.g. to avoid packing fp16 and fp32 parameters with FSDP)
@universome universome deleted the patch-1 branch April 21, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants